package day04;

import java.util.Scanner;

/**
 * 说明:
 *
 * @author: luohaowei
 * @date:2023/2/15
 **/
public class zy2 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int num = (int) (Math.random() * 1000 + 1);
        System.out.println("猜吧");
        int guess=scan.nextInt();
        while (guess!=num) {
            if (guess > num) {
                System.out.println("猜大了");
            }else{
                System.out.println("猜小了");
            }
            System.out.println("猜吧!");
            guess = scan.nextInt();
        }
        System.out.println("猜对了");
        /*
        Scanner scan = new Scanner(System.in);

        int num = (int) (Math.random() * 1000 + 1);
        System.out.println("猜吧");
        int guess=scan.nextInt();
        while (guess!=num) {
            if (guess > num) {
                System.out.println("猜大了");
            }else{
                System.out.println("猜小了");
            }
            System.out.println("猜吧!");
            guess = scan.nextInt();
        }
        System.out.println("猜对了");
         */
        for(int num1=1;num1<=9;num1++){
            System.out.println(num1+"*9="+num1*9);
        }
//System.out.println(num); //编译错误，超出num作用域了
        for(int num1=1;num1<=9;num1+=2){
            System.out.println(num1+"*9="+num1*9);
        }
        for(int num1=9;num1>=1;num1--){
            System.out.println(num1+"*9="+num1*9);
        }
        /*
            for(int num1=1;num1<=9;num1++){
            System.out.println(num1+"*9="+num1*9);
        }
//System.out.println(num); //编译错误，超出num作用域了
        for(int num1=1;num1<=9;num1+=2){
            System.out.println(num1+"*9="+num1*9);
        }
        for(int num1=9;num1>=1;num1--){
            System.out.println(num1+"*9="+num1*9);
        }
         */
        for(int times=0;times<5;times++){
            System.out.println("行动是成功的阶梯");
        }
        System.out.println("继续执行...");
    /*
        执行过程:
            times=0 true 输出
            times=1 true 输出
            times=2 true 输出
            times=3 true 输出
            times=4 true 输出
            times=5 false for循环结束
            输出继续执行...
     */

        /*
        for(int times=0;times<5;times++){
            System.out.println("行动是成功的阶梯");
                                        }
                System.out.println("继续执行...");
         /*
                    执行过程:
                    times=0 true 输出
                    times=1 true 输出
                    times=2 true 输出
                    times=3 true 输出
                    times=4 true 输出
                    times=5 false for循环结束
                    输出继续执行...
*/

    }

}
